var windowName = "userCoin";
var Page,Log;
apiready = function(){
    onWindowShow(function () {
        console.log(windowName + " show")
    })
    onWindowHide(function () {
        console.log(windowName + " hide")
    })
    console.log("index page is OK");
    Log = new List();
    Page = createVM("#Page",{
        money:"-"
        ,signCount:"0"
        ,signCheck:"0"
        ,set:[["1","2"],["2","5"],["3","10"],["4","15"],["5","20"],["6","25"],["7","50"]]
        ,log:[]
    },{
        //页面方法
        "init":function () {
            Log.setUrl("/app/user/money/log").setData({type:"jifen"}).setCbFunc(function (res) {
                clearLoading();
                logJson(res,"jifen")
                Page.log = res
            }).getList();
            getData()
        }
        , sign: function () {
            apiGet("/app/user/sign",{},function (res,code) {
                logJson(res)
                showToast(res.message)
                if (code == 200) {
                    Log.reload();
                    getData()
                }
            })
        }
    })
    Page.init();
    onPullUpLoadMore(function () {
        Log.getList()
    })
}
function getData() {
    apiGet("/app/sign/config",{},function (res,code) {
        logJson(res)
        Page.money = res.data.jifen
        Page.set = res.data.set
        Page.signCount = res.data.signCount
        Page.signCheck = res.data.checkSign
    })
}
